Decompression of MPEG-2 data requires synchronization between audio and visual components. The precise time to present uncompressed data is generally indeterminate relative to the time when the data is received in compressed form. However, through presentation time stamps (PTS) it is possible to positively identify specific presentation times for audio, visual or auxiliary data. Program clock reference time stamps that are given a ‘stream time’ are transmitted in the adaptation field of audio or visual packets or auxiliary data (depending which stream is a master) at least ten times every second. Having a stream time and “stamping” the data associated with packets with a PTS, a system may establish a reference to which time the data should be given to the audio/video/auxiliary decoder. PTS is available at a packetized elementary stream (PES) header, usually with the start of a video or audio frame in a PES packet payload, where a PES packet is received through a multimedia transport stream as a plurality of transport stream packets.
The reference time used by the decoder that qualifies the PTS time is referred to as the system time clock (STC). The STC is a counter, or clock reference, maintained by the receiving (decoder) system. By comparing the values of the PTS time stamps to the system time clock and rendering the data associated with the PTS time stamps when a match occurs, a decoder may obtain synchronized presentation of audio and visual data. Note that the STC includes a nine-bit extension portion, which acts as a prescaler for clocking a 33-bit base portion. The PTS has only a 33-bit portion. A decoder may compare the PTS time stamp is to the STC's 33-bit base portion.
A decoder compares the separate PTS time stamps related to the audio and video data to attempts audio and video synchronization. The separate PTS time stamps are sent to each respective video or audio decoder. A video PTS tells the video decoder when to play video and an audio PTS tells the audio decoder when to play audio. While each of the presentation time stamps indicate when to play respective data, irregularities between video decoding and audio decoding may cause the audio data to be played out of sync with the video data. For example, the amount of time to decode video data may take much longer than the time to decode related audio data. The delay added when switching channels may also present decoding delays into the decoders. When audio data becomes out of sync with video data, various artifacts may be noticed by a viewer. Played audio may not be ‘lip-synced’ with played video data. The audio data may also be broken, as new audio data is played to interrupt expired audio data. Given the discussion above, it is apparent that a system and method for maintaining synchronization of audio data that overcomes at least some of these problems would be advantageous.